
CCFLAGS = -g -Wall -lpthread

main: main.c memory.h start_memory.h get_memory.h release_memory.h grow_memory.h pregrow_memory.h end_memory.h memory.o start_memory.o get_memory.o release_memory.o grow_memory.o pregrow_memory.o end_memory.o
	gcc $(CCFLAGS) -o main main.c memory.o start_memory.o get_memory.o release_memory.o grow_memory.o pregrow_memory.o end_memory.o

memory.o: memory.c memory.h
	gcc $(CCFLAGS) -c memory.c

start_memory.o: start_memory.c memory.h
	gcc $(CCFLAGS) -c start_memory.c

end_memory.o: end_memory.c memory.h
	gcc $(CCFLAGS) -c end_memory.c
	
get_memory.o: get_memory.c memory.h
	gcc $(CCFLAGS) -c get_memory.c

release_memory.o: release_memory.c memory.h
	gcc $(CCFLAGS) -c release_memory.c
	
grow_memory.o: grow_memory.c memory.h
	gcc $(CCFLAGS) -c grow_memory.c

pregrow_memory.o: pregrow_memory.c memory.h
	gcc $(CCFLAGS) -c pregrow_memory.c
	
clean:
	-rm start_memory.o memory.o release_memory.o grow_memory.o get_memory.o pregrow_memory.o end_memory.o


spotless: clean
	-rm main

